package pl.poznan.put.cs.idss.particlefilter.utils;

import java.awt.Point;
import java.io.IOException;

import pl.poznan.put.cs.idss.particlefilter.agent.Particle;

/**
 * Kopiuje cząsteczkę.
 * 
 */
public class CopyParticle {

	public static Particle copyParticle(Particle p) {
		Particle pNew = null;
		try {
			pNew = new Particle(p.getWorldMap());
			pNew.setPos((Point) DeepCopy.copy(p.getPos()));
			pNew.setTurn((Point) DeepCopy.copy(p.getTurn()));
			pNew.setAngle(p.getAngle());
		} catch (InterruptedException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return pNew;
	}

}
